#pragma once

#include "ProtocolStateMachine.h"

#include "ProtocolConformance.h"

namespace uml {

ProtocolStateMachine::ProtocolStateMachine(const QString& umlType)
    : StateMachine(umlType) {}

void ProtocolStateMachine::fromJson(const QJsonObject& json, QStringList& errorList) {
    if (json.isEmpty()) {
        return;
    }

    StateMachine::fromJson(json, errorList);
    JsonSerializable::fromJsonArray(conformances_, "conformances", json, errorList);
}

void ProtocolStateMachine::toJson(QJsonObject& json) {
    StateMachine::toJson(json);
    JsonSerializable::toJsonArray(conformances_, "conformances", json);
}

/// <summary>
/// conformances getter
/// Conformance between ProtocolStateMachine 
/// </summary>
vector<shared_ptr<ProtocolConformance>>& ProtocolStateMachine::conformances() {
    return conformances_;
}

} // namespace uml
